<html>
<head><meta charset="utf-8"><title>Match binding modes again · clippy · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/index.html">clippy</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/Match.20binding.20modes.20again.html">Match binding modes again</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="228299344"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/Match%20binding%20modes%20again/near/228299344" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Manish Goregaokar <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/Match.20binding.20modes.20again.html#228299344">(Mar 01 2021 at 20:21)</a>:</h4>
<p>Check out <a href="https://internals.rust-lang.org/t/clippy-lint-against-or-some-other-way-of-detecting-default-binding-modes-take-2/14131">https://internals.rust-lang.org/t/clippy-lint-against-or-some-other-way-of-detecting-default-binding-modes-take-2/14131</a>, especially my response in <a href="https://internals.rust-lang.org/t/clippy-lint-against-or-some-other-way-of-detecting-default-binding-modes-take-2/14131/24?u=manishearth">https://internals.rust-lang.org/t/clippy-lint-against-or-some-other-way-of-detecting-default-binding-modes-take-2/14131/24?u=manishearth</a></p>



<a name="228299388"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/Match%20binding%20modes%20again/near/228299388" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Manish Goregaokar <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/Match.20binding.20modes.20again.html#228299388">(Mar 01 2021 at 20:21)</a>:</h4>
<p>TLDR: someone proposed removing match binding modes again, and it later transpired someone had already landed a restriction lint on it (in a way i kinda agree with)</p>



<a name="228299514"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/Match%20binding%20modes%20again/near/228299514" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Manish Goregaokar <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/Match.20binding.20modes.20again.html#228299514">(Mar 01 2021 at 20:22)</a>:</h4>
<p>I do think this indicates that we need to have a clearer idea on what a restriction lint is</p>



<a name="228299534"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/Match%20binding%20modes%20again/near/228299534" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Manish Goregaokar <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/Match.20binding.20modes.20again.html#228299534">(Mar 01 2021 at 20:22)</a>:</h4>
<p>even though i agree with the one that landed -- others do disagree</p>



<a name="228321220"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/Match%20binding%20modes%20again/near/228321220" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Cameron Steffen <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/Match.20binding.20modes.20again.html#228321220">(Mar 01 2021 at 22:52)</a>:</h4>
<p>Am I understanding right - the question is - is it okay to have a restriction lint that lints an entire language feature?</p>



<a name="228321637"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/Match%20binding%20modes%20again/near/228321637" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Cameron Steffen <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/Match.20binding.20modes.20again.html#228321637">(Mar 01 2021 at 22:56)</a>:</h4>
<p>Sounds like the answer to that question is no. So, we need a definition of restriction lint that clearly excludes that possibility?</p>



<a name="228321934"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/Match%20binding%20modes%20again/near/228321934" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Cameron Steffen <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/Match.20binding.20modes.20again.html#228321934">(Mar 01 2021 at 22:58)</a>:</h4>
<p>With regard to the lint that was added, to me it seems like it is effectively the same as <code>no_binding_modes</code>.</p>



<a name="228325938"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/Match%20binding%20modes%20again/near/228325938" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> flip1995 <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/Match.20binding.20modes.20again.html#228325938">(Mar 01 2021 at 23:32)</a>:</h4>
<p>I don't think we have to take immediate action here and think hard about a definition of the <code>restriction</code> group. I think we should better define the groups in general. (Best to do this in a Clippy book).</p>
<p>For the lint in question: I reviewed and ultimately merged this lint. I still think this lint is a positive addition to Clippy, because it can be used to teach people, that are new to Rust and come in contact with pattern matching for the first time. I set the bar for the documentation and the produced suggestions really high for this lint, something I usually don't do for <code>restriction</code> lints. I also left a rather lengthy comment on the IRLO thread about that.</p>



<a name="228326480"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/Match%20binding%20modes%20again/near/228326480" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Manish Goregaokar <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/Match.20binding.20modes.20again.html#228326480">(Mar 01 2021 at 23:36)</a>:</h4>
<p><span class="user-mention" data-user-id="264664">@flip1995</span>  Yeah I agree, and I agree with the reasoning in your comment there. I do think we should have a more concrete policy around <code>restriction</code>, though I think the <code>pattern_whatever</code> lint that landed is _fine_ (personally speaking)</p>



<a name="228334935"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/Match%20binding%20modes%20again/near/228334935" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Cameron Steffen <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/Match.20binding.20modes.20again.html#228334935">(Mar 02 2021 at 00:51)</a>:</h4>
<p>Just to clarify, what I said above was a quick reaction. I don't have any issue with the decision process that went into that lint.</p>



<a name="228341250"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/Match%20binding%20modes%20again/near/228341250" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Manish Goregaokar <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/Match.20binding.20modes.20again.html#228341250">(Mar 02 2021 at 02:03)</a>:</h4>
<p>Oh yeah I understood :)</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>